package com.vinoxm.infoc.dao;

import com.vinoxm.infoc.model.SteamAccount;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

public interface TOTPDao extends BaseDao {

    @Results(id = "steamAccountMap", value = {
            @Result(property = "steamId", column = "steam_id", id = true),
            @Result(property = "sharedSecret", column = "shared_secret", id = true),
            @Result(property = "serialNumber", column = "serial_number", id = true),
            @Result(property = "revocationCode", column = "revocation_code", id = true),
            @Result(property = "uri", column = "uri", id = true),
            @Result(property = "serverTime", column = "server_time", id = true),
            @Result(property = "accountName", column = "account_name", id = true),
            @Result(property = "tokenGid", column = "token_gid", id = true),
            @Result(property = "identitySecret", column = "identity_secret", id = true),
            @Result(property = "secret1", column = "secret_1", id = true),
            @Result(property = "status", column = "status", id = true),
            @Result(property = "steamGuardScheme", column = "steamguard_scheme", id = true),
    })
    @Select("SELECT " +
            "steam_id,shared_secret,serial_number,revocation_code,uri,server_time,account_name,token_gid,identity_secret,secret_1,status,steamguard_scheme " +
            "FROM steam_account " +
            "WHERE account_name=#{name}")
    SteamAccount selOneByName(String name);

}
